import client from './client';

export interface TrafficStats {
  users: Record<string, UserTraffic>;
  total_tx: number;
  total_rx: number;
}

export interface UserTraffic {
  tx: number;
  rx: number;
  online: boolean;
  connections: number;
}

export const getTrafficStats = () => client.get('/traffic/stats');

export const getOnlineUsers = () => client.get('/traffic/online');

export const getTrafficHistory = (params?: any) => 
  client.get('/traffic/history', { params });
